unit u_timer;

interface

uses
  windows;

type

  C_timer = class
    private
      temps_dep : cardinal;
      temps_lat : cardinal;
    public
      procedure init(lat : cardinal);
      function test() : boolean;
  end;

implementation

procedure C_timer.init(lat : cardinal);
begin
  temps_dep := getcurrenttime;
  temps_lat := lat;
end;

function C_timer.test;
begin
  result := false;
  if (getcurrenttime - self.temps_dep) >= self.temps_lat then
    begin
      result := true;
      self.temps_dep := getcurrenttime;
    end;
end;

end.
